package com.ivvi.autoreco.opencv;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.ivvi.autoreco.R;

import org.opencv.ivvi.custom.BitmapHelper;
import org.opencv.ivvi.custom.CropType;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by duanxianping on 2017/6/7.
 */

public class ZHHActivity extends AppCompatActivity {


    @BindView(R.id.iv_left)
    ImageView ivLeft;
    @BindView(R.id.iv_left_zhh)
    ImageView ivLeftZhh;
    @BindView(R.id.iv_left_zft)
    ImageView ivLeftZft;
    @BindView(R.id.iv_left_zhh_zft)
    ImageView ivLeftZhhZft;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhh);
        ButterKnife.bind(this);

        Bitmap ori = BitmapHelper.compress("/storage/emulated/0/DCIM/3D1/美女3D/26.jpg", 320, 180);
        Bitmap left = BitmapHelper.createBitmap(ori, CropType.LEFT);
        Bitmap zhhLeftBitmap = Helper.equalizeHist(left);

        ivLeft.setImageBitmap(left);
        ivLeftZhh.setImageBitmap(zhhLeftBitmap);

        Bitmap leftZft = Helper.hist(left);
        Bitmap leftZftZhh = Helper.hist(zhhLeftBitmap);

        ivLeftZft.setImageBitmap(leftZft);
        ivLeftZhhZft.setImageBitmap(leftZftZhh);

    }

}
